import request from '@/utils/request'

// 查询版本列表
export function listVersion(query) {
  return request({
    url: '/system/serverVersion/list',
    method: 'get',
    params: query
  })
}
// 查询JAVA版本
export function getJaveVersion(query) {
  return request({
    url: '/system/serverVersion/javaVersion',
    method: 'get',
    params: query
  })
}
// 查询版本详细
export function getVersion(id) {
  return request({
    url: '/system/serverVersion/' + id,
    method: 'get'
  })
}

// 新增版本
export function addVersion(data) {
  return request({
    url: '/system/serverVersion/save',
    method: 'post',
    data: data
  })
}

// 修改版本
export function editVersion(data) {
  return request({
    url: '/system/serverVersion/update',
    method: 'put',
    data: data
  })
}

// 删除版本
export function delVersion(id) {
  return request({
    url: '/system/serverVersion/remove/' + id,
    method: 'delete'
  })
}

// 导出版本
export function exportVersion(query) {
  return request({
    url: '/system/serverVersion/export',
    method: 'get',
    params: query
  })
}

// 发布
export function releaseVersion(query) {
  return request({
    url: '/system/serverVersion/run',
    method: 'get',
    params: query
  })
}

// 解压
export function unZipVersion(query) {
  return request({
    url: '/system/serverVersion/unZip',
    method: 'get',
    params: query
  })
}

// 获取设备授权信息列表
export function getLicenseList(params) {
  return request({
    url: '/ips/device/licenseList',
    method: 'get',
    params
  })
}
// 导入设备授权 updateSupport
export function importLicense(data) {
  return request({
    url: '/ips/device/importDeviceLicense',
    method: 'post',
    data
  })
}
// 导出设备授权 updateSupport
export function exportLicense(id) {
  return request({
    url: `/ips/device/exportDeviceLicense/${id}`,
    method: 'get'
  })
}
